#ifndef CIRCLEITEM_H
#define CIRCLEITEM_H

#include "ShapeItem.h"

class CircleItem : public ShapeItem
{
    Q_OBJECT
    Q_PROPERTY(QPointF center READ center WRITE setCenter NOTIFY centerChanged)
    Q_PROPERTY(float radius READ radius WRITE setRadius NOTIFY radiusChanged)
    Q_PROPERTY(int segmentCount READ segmentCount WRITE setSegmentCount NOTIFY segmentCountChanged)
public:
    explicit CircleItem(QQuickItem *parent = 0);

    QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *);

    QPointF center() const { return m_center; }
    float radius() const { return m_radius; }
    int segmentCount() const { return m_segmentCount; }

    void setCenter(const QPointF &cen);
    void setRadius(float r);
    void setSegmentCount(int count);

    virtual Type shapeType() const { return ShapeItem::Circle; }
    
signals:
    void centerChanged(const QPointF &cen);
    void radiusChanged(float r);
    void segmentCountChanged(int count);

private:
    QPointF m_center;
    float m_radius;
    
    int m_segmentCount;
};

#endif // CIRCLEITEM_H
